<template>
	<view class="set">
		<view class="card">
			<view class="list" @click="$util.toUrl('/pages/setting/policy?type=store_service')">
				<view class="title">
					<view>用户协议</view>
				</view>
				<uni-icons type="forward" :size="22" color="#666"></uni-icons>
			</view>
			<view class="list" @click="$util.toUrl('/pages/setting/policy?type=store_privacy')">
				<view class="title">
					<view>隐私协议</view>
				</view>
				<uni-icons type="forward" :size="22" color="#666"></uni-icons>
			</view>
			<view class="list no_border" @click="$util.toUrl('/pages/agreement/store_logout')">
				<view class="title">
					<view>注销协议</view>
				</view>
				<uni-icons type="forward" :size="22" color="#666"></uni-icons>
			</view>
		</view>
		
		<view class="card">
			<view class="list" @click="$util.msg(`当前版本${code || '1.0.0'}`)">
				<view class="title">
					<view>版本</view>
				</view>
				<view class="flex_box" style="align-items: center;">
					<text style="color: #666;font-size: 30rpx;margin-right: 10rpx;">{{code || '1.0.0'}}</text>
				</view>
			</view>
			<view class="list no_border" @click="$util.toUrl('/pages/setting/cancel')">
				<view class="title">
					<view>注销账号</view>
				</view>
				<uni-icons type="forward" :size="22" color="#666"></uni-icons>
			</view>
		</view>
		
		<view class="card">
			<view class="list no_border" @click="$util.toUrl('/pages/setting/authorize')">
				<view class="title">
					<view>系统权限管理</view>
				</view>
				<uni-icons type="forward" :size="22" color="#666"></uni-icons>
			</view>
		</view>
		
		<view class="btn" @click="outLine">
			退出登录
		</view>
		
		
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				code:'',
			}
		},
		methods: {
			outLine(){
				this.$get("login/logout").then(res=>{
					uni.removeStorageSync('token')
					uni.removeStorageSync('store')
					uni.reLaunch({
						url:'/pages/login/login'
					})
				})
			},
		},
		onLoad() {
			uni.getSystemInfo({
				success: res => {
					this.code = res.appVersion
				}
			})
		}
	}
</script>

<style scoped lang="less">
	.set {
		padding: 0rpx 0 20rpx;
		.list {
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1rpx solid #DDDDDD;
			padding: 20rpx 0 20rpx;
			image {
				width: 14rpx;
				height: 25rpx;
			}
			.title {
				view {
					height: 42rpx;
					font-size: 26rpx;
					color: #666666;
					line-height: 42rpx;
				}
			}
		}
	}

	.card {
		background: #FFF;
		margin-bottom: 20rpx;
		padding: 0 30rpx;
	}
	
	.btn {
		margin: 40rpx 30rpx 0;
		height: 78rpx;
		line-height: 78rpx;
		background: #2E7EFA;
		border-radius: 20rpx;
		text-align: center;
		font-size: 30rpx;
		color: #FFFFFF;
	}

</style>
